$(() => {
    const token = GetQueryString("token");

    if (token == '') {
        $('.dropOut').hide();
    }

    $('.dropOut').on('click', function() {
        $.ajax({
            type: "post",
            url: url,
            data: { 'method': 'User|login_out', 'token': token },
            dataType: 'json',
            success: function(res) {
                if (res.status == 1) {
                    location.href = "fox://logout2";
                } else if (res.status == 2) {
                    location.href = "fox://logout";
                } else {
                    alert(res.message);
                }
            }
        })
    })

    // 联系我们
    $('.agreement').on('click', function() {
        location.href = "textDetail.html?article_code=agreements";
    })
    // 使用协议
    $('.about_us').on('click', function() {
        location.href = "textDetail.html?article_code=about_us";
    })

    // 清除缓存
    $('.clearBtn').on('click', function() {
        if (isAndroid_ios()) {
            //安卓  
            window.android.clearCache();
            $('.cacheText').html(window.android.getCacheSize());
        } else {
            //ios
            window.webkit.messageHandlers.clearCache.postMessage('parameter');
            $('.cacheText').html(window.webkit.messageHandlers.getCacheSize.postMessage('parameter'));
        }
    })
})